package com.foreknow.mapping;

import com.foreknow.model.Person;

import java.sql.ResultSet;
import java.sql.SQLException;

public class PersonMapping implements EntityMapping {
    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Person person = new Person();
        person.setId(rs.getInt("id"));
        person.setName(rs.getString("name"));
        person.setAge(rs.getInt("age"));
        person.setAddress(rs.getString("address"));
        person.setSchool(rs.getString("school"));
        return person;
    }
}
